<template>
  <view>
      <AuthForm
        v-if="showAuth"
        :authinfo="authinfo"
        @reload="reload"
      ></AuthForm>
    <view v-else>
      <view class="form_split_10"></view>
      <view class="box" v-if="authinfo.audit == 1">
        <view class="ico success"></view>
        <view class="text">已通过营业执照认证</view>
      </view>
      <view class="box" v-if="authinfo.audit == 3">
        <view class="ico ing"></view>
        <view class="text_ing">我们将在1个工作日内审核您的资料信息</view>
      </view>
      <view class="box" v-if="authinfo.audit == 2">
        <view class="ico fail"></view>
        <view class="text">营业执照认证未通过审核！</view>
        <view class="text_red">
          原因：{{ authinfo.audit_reason }}，请重新认证。
        </view>
        <view class="btn">
          <u-button type="primary" shape="square" @click="handlerAuthRepeat">
            重新认证
          </u-button>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import AuthForm from '@/components/account/company_auth/AuthForm'
export default {
  name: 'AuthResult',
  props: ['authinfo'],
  components: {
    AuthForm
  },
  data () {
    return {
      showAuth: false
    }
  },
  methods: {
    handlerAuthRepeat () {
      this.showAuth = true
    },
    reload () {
      this.showAuth = false
      this.$emit('reload')
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  .text_ing {
    font-size: 26rpx;
    color: #666666;
    padding-top: 24rpx;
  }
  .btn {
    padding: 132rpx 60rpx 0 60rpx;
  }
  .text_red {
    padding-top: 24rpx;
    font-size: 26rpx;
    color: #ff0000;
  }
  .text {
    font-size: 34rpx;
    font-weight: bold;
    color: #333333;
    padding-top: 28rpx;
  }
  .ico {
    &.ing {
      background-image: url($ImgUrl + "auth_ico_ing.png");
	  background-position: 0;
	  background-repeat: no-repeat;
      background-size: 110rpx;
    }
    &.success {
      background-image: url($ImgUrl + "auth_ico_success.png");
	  background-position: 0;
	  background-repeat: no-repeat;
      background-size: 110rpx;
    }
    &.fail {
      background-image: url($ImgUrl + "auth_ico_fail.png");
	  background-position: 0;
	  background-repeat: no-repeat;
      background-size: 110rpx;
    }
    width: 110rpx;
    height: 110rpx;
    margin: 0 auto;
  }
  width: 100%;
  text-align: center;
  padding-top: 192rpx;
}
</style>
